﻿// ---------- ----------
// code specific to the Intro state
// ---------- ----------
int SECS_IN_INTRO = 5;
logoPolytech= loadImage("res/logo.jpg");
int x_act;
int y_act;
float max_distance = dist(0, 0, width, height);   

void keyPressedIntro ()
{
	if ( key == ' ' )
	{
		state = 1;
		justCameIn = 1;
	}
	else if ( key == 'a' )
	{
		play_multi_sound ( 'multiaudio1' );
	}
	draw();
}

void drawIntro ()
{
	background ( 255 );
	fill ( 255 );
	text("intro",20,20);
	float timeEllapsed = millis () - timeStartGame;
	if ( timeEllapsed > SECS_IN_INTRO *1000 )
		++state;
	
	textAlign(CENTER);
	PFont fontA = loadFont("arial");
	int size=20;
	fill ( 0 );
	textFont(fontA, size);
	text ( "Quentin Grimaud, Michael Gygli et Jérôme Gutierrez présentent", 10, height/2-size-100,width-10,width-20);	
	
	if (timeEllapsed > (SECS_IN_INTRO*300)) {
		int size=60;
		textFont(fontA, size);
		text ( "Gare à l'aiguillage", 10, height/2-size,width-10,width-20);	
	}
	if (timeEllapsed > (SECS_IN_INTRO*600)) {
		int size=30;
		textFont(fontA, size);
		text ( "un projet du cours CAMASH", 10, height/2+size,width-10,width-20);	
	}
	 image(logoPolytech, 0, 0);

}

